package com.hxzy.service.impl;

import com.hxzy.dto.HouseRenovationSearchDTO;
import com.hxzy.entity.HouseRenovation;
import com.hxzy.mapper.HouseRenovationMapper;
import com.hxzy.service.HouseRenovationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;


@Transactional(rollbackFor = Exception.class)
@Service
public class HouseRenovationServiceImpl extends CommonServiceImpl<HouseRenovation, Integer> implements HouseRenovationService {

    private HouseRenovationMapper houseRenovationMapper;

    @Autowired
    public void setRenovationMapper(HouseRenovationMapper houseRenovationMapper) {
        this.houseRenovationMapper = houseRenovationMapper;
        this.setMyBatisBaseDao(houseRenovationMapper);
    }

    @Override
    public List<HouseRenovation> search(HouseRenovationSearchDTO houseRenovationSearchDTO) {
        return this.houseRenovationMapper.search(houseRenovationSearchDTO);
    }

    @Override
    public int existsName(Integer id, String name) {
        return this.houseRenovationMapper.existsName(id, name);
    }
}
